package com.dy.design_pattern_study.visitor_pattern.dome2;

import com.dy.design_pattern_study.visitor_pattern.dome2.impl.*;
import com.dy.design_pattern_study.visitor_pattern.dome2.impl.status.Amativeness;
import com.dy.design_pattern_study.visitor_pattern.dome2.impl.status.Failing;
import com.dy.design_pattern_study.visitor_pattern.dome2.impl.status.Marriage;
import com.dy.design_pattern_study.visitor_pattern.dome2.impl.status.Success;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-04-25
 * @Content
 */
public class client {
    public static void main(String[] args) {
        //在对象结构中加入要对比的 "man" and "woman"
        ObjectStructure o = new ObjectStructure();

        //设置具体的性别
        //在这里，具体的属性是稳定的，如果不稳定，就需要修改类Action和其子类、新增类
        o.attach(new Man());
        o.attach(new Woman());

        //根据不同状态 设置不同的反应
        Success v1 = new Success();
        o.display(v1);

        Failing v2 = new Failing();
        o.display(v2);

        Amativeness v3 = new Amativeness();
        o.display(v3);

        Marriage v4 = new Marriage();
        o.display(v4);
    }
}
